<?php

namespace frontend\modules\yii2\widgets\layouts\markdown;

use frontend\modules\yii2\widgets\layouts\markdown\assets\MarkdownAsset;
use Yii;
use yii\base\Widget;
use yii\bootstrap\Html;

/**
 * A menu imitate the sidebar of https://docs.docker.com/get-started/
 *
 * @note It's depend on bootstrap;
 *
 * @example :
 * ```php

 * ```
 * @author chenzhiwei <chenzhiweiwk@qq.com>
 * @date   2021/08/31
 */
class Markdown extends Widget
{
    public $class = "";
    public $style = "";
    public $content = "# Hello World";

    public function init()
    {
        parent::init(); // TODO: Change the autogenerated stub
        MarkdownAsset::register($this->getView());
    }

    public function run()
    {
        return \yii\helpers\Markdown::process($this->content, "gfm");
    }

}
